[3.9] gh-121285: Remove backtracking when parsing tarfile headers (GH-121286) (#123641)
authorSeth Michael Larson <seth@python.org>
Wed, 4 Sep 2024 15:46:01 +0000 (10:46 -0500)
committerArnaud Rebillout <arnaudr@debian.org>
Tue, 14 Apr 2026 04:38:32 +0000 (11:38 +0700)
commitb84617b0270b6fbb6ca1714f9a6a5dce07a3a76d
tree4300adf05011eecf1bbdf06eda4fe9c8ba1f525d
parent1f444262ed65089d018dfc7f335151435f0abf6f
[3.9] gh-121285: Remove backtracking when parsing tarfile headers (GH-121286) (#123641)

* Remove backtracking when parsing tarfile headers
* Rewrite PAX header parsing to be stricter
* Optimize parsing of GNU extended sparse headers v0.0

(cherry picked from commit 34ddb64d088dd7ccc321f6103d23153256caa5d4)

Co-authored-by: Seth Michael Larson <seth@python.org>
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Gbp-Pq: Name 0022-3.9-gh-121285-Remove-backtracking-when-parsing-tarfi.patch
Lib/tarfile.py
Lib/test/test_tarfile.py